<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>[|.pageTitle|]</title>
    [|if .zTree|]
    <link rel="stylesheet" href="/static/zTree3/css/demo.css?t=5" type="text/css">
    <link rel="stylesheet" href="/static/zTree3/css/zTreeStyle/zTreeStyle.css" type="text/css">
    [|end|]
    <meta charset="utf-8">
    <link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/css/main.css">
    <script src="/static/layui/layui.js?s=36"></script>
    <script src="/static/js/main.js?s=2124"></script>
    <script src="/static/js/echarts.js"></script>
</head>
<body>
<div class="layui-layout layui-layout-admin" style="margin-top: 20px;">
    <form class="layui-form"  style="padding-left:40px;">
        <div class="layui-inline  layui-form-item">
            <label class="layui-form-label"  style="width:160px">玩家推广号：</label>
            <div class="layui-input-inline"  style="width:140px;">
                <input type="number" class="layui-input" id="UserGameID" lay-verify="">
            </div>
            <label class="layui-form-label">时间：</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="BeforDateTime" placeholder="" readonly>
            </div>
            <div class="layui-form-mid layui-word-aux">-</div>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="AfterDateTime" placeholder="" readonly>
            </div>

            <div class="layui-btn-group" >
                <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="starquery">开始查询</button>
            </div>
    </div> 
        </div>
    </form>

    <table  class="layui-table" id="userinfotable" lay-size="sm" lay-filter="layfilteruserinfotable"> </table> 

</div>
<script>
    var $;

    layui.config({
            base : "js/"
    }).use(['form','element','layer','jquery','table','laydate'], function(){
        var table = layui.table;
        var element = layui.element;
        var form = layui.form;
        var laydate = layui.laydate;
        $ = layui.jquery;
    //监听表格复选框选择
   // table.on('checkbox(demo)', function(obj){
    //   console.log(obj);
   // });

    //监听工具条
      laydate.render({
        elem: '#BeforDateTime'
        ,type: 'datetime'
      });
    laydate.render({
        elem: '#AfterDateTime'
        ,type: 'datetime'
    });

    ShowTablesDatas(table)
    form.on('submit(starquery)', function(data) {
         
      ShowTablesDatas(table)
        
        return false;
    });

    //监听单元格事件
    table.on('tool(layfilteruserinfotable)', function(obj){
        var data = obj.data;
        if(obj.event === 'UserInfo'){
            window.location.href="/usersfinduser/userinfopage.html?UserID=" + data.UserID +"&UserNickName=" + data.UserNickName;
            return false;
        }
      });
   
    return false;
}); 


function ShowTablesDatas(thisTabble){
 
    var dUserGameID =  document.getElementById("UserGameID");
    var dBeforDateTime =  document.getElementById("BeforDateTime");
    var dAfterDateTime =  document.getElementById("AfterDateTime");
    localStorage["gameid"] = dUserGameID.value;
    thisTabble.render({
        elem:'#userinfotable'
        ,url:'/userrecord/userrecordlocktable'
        ,where: {
                UserGameID: dUserGameID.value
                ,BeforDateTime: dBeforDateTime.value
                ,AfterDateTime:dAfterDateTime.value
       
        }
        ,cols: [[ //标题栏
        
            {field:'UserID',title:'推广号',width:140, event: 'UserInfo', style:'cursor: pointer;color: #104E8B;'}
            ,{field:'UserNickName',title:'昵称',width:140, event: 'UserInfo', style:'cursor: pointer;color: #104E8B;'}
            ,{field:'RegTime',title:'注册时间',width:160}
            ,{field:'LastLoginTime',title:'最后登录时间',width:160}
            ,{field:'uallgold',title:'资产',width:160}
            ,{field:'uallwin',title:'总输赢',width:160}
            ,{field:'oType',title:'类型',width:100}
            ,{field:'reson',title:'说明',width:350}
            ,{field:'operatetime',title:'操作时间',width:160}
            ,{field:'GmName',title:'操作用户',width:160}
                ]] 
        ,skin: 'row' //表格风格
        ,even: true
        ,page: true //是否显示分页
        ,limits: [50,100,200]
        ,limit: 100//每页默认显示的数量
        ,width: 'full-10'
        ,rules: 'all'
        ,height: 'full-170'
    });
}
 

</script>
</body>
</html>